Revision: fakeroot--main--0.0--patch-67
Archive: fakeroot@packages.debian.org--fakeroot
Creator: Timo Savola <tsavola@movial.fi>
Date: Fri May 20 17:14:12 EEST 2005
Standard-date: 2005-05-20 14:14:12 GMT
Modified-files: communicate.c communicate.h libfakeroot.c
    wrapfunc.inp
New-patches: fakeroot@packages.debian.org--fakeroot/fakeroot--main--0.0--patch-67
Summary: Wrap close and dup2 to avoid closing TCP socket
Keywords: 

close(2) doesn't allow closing of the communication socket used by the TCP
version.  When dup2(2) is called with the communication socket as the
target file descriptor, it will first dup(2) the socket to a new number.
This makes the --fd-base option and the checking obsolete.

The comm_sd variable is exported for libfakeroot.c which is also
responsible for locking.  comm_sd and the comm_sd-related functions are
not exported for faked.c because it doesn't use that functionality AND it
has its own comm_sd variable...  (Declarations needed by the TCP version
of faked.c should be split away from communication.h in the future.)

The fork(2) wrapper is changed to preserve errno correctly, and it no
longer locks when closing the comm_sd of the child process.  The socket is
now also set to close-on-exec.
